<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /**
     * 直接量的定义：
     */
    var u = {};
    var u2 = {
        username:'frank'
    }
    var x = 10;
    var u3 = {
        age:x
    }
    /*对象的访问*/
    //u2.username
    //u3.age

    //第1种方式
    //对象名.属性
    var c = u2.username + u3.age;
    console.log(c);
    //第2种方式
    //对象名[属性名]
    console.log(u2['username'])

</script>
</body>
</html>